<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>netaddr.address.CIDR</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="netaddr-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://netaddr.googlecode.com/">Project Homepage</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="netaddr-module.html">Package&nbsp;netaddr</a> ::
        <a href="netaddr.address-module.html" onclick="show_private();">Module&nbsp;address</a> ::
        Class&nbsp;CIDR
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="netaddr.address.CIDR-class.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class CIDR</h1><p class="nomargin-top"><span class="codelink"><a href="netaddr.address-pysrc.html#CIDR">source&nbsp;code</a></span></p>
<pre class="base-tree">
object --+    
         |    
   <a href="netaddr.address.IPRange-class.html">IPRange</a> --+
             |
            <strong class="uidshort">CIDR</strong>
</pre>

<hr />
<p>Represents blocks of IPv4 and IPv6 addresses using CIDR (Classless 
  Inter-Domain Routing) notation.</p>
  <p>CIDR is a method of categorising contiguous blocks of both IPv4 and 
  IPv6 addresses. It is very scalable allowing for the optimal usage of the
  IP address space. It permits the aggregation of networks via route 
  summarisation (supernetting) where adjacent routes can be combined into a
  single route easily. This greatly assists in the reduction of routing 
  table sizes and improves network router efficiency.</p>
  <p>CIDR blocks are represented by a base network address and a prefix 
  indicating the size of the (variable length) subnet mask. These are 
  separated by a single '/' character. Subnet sizes increase in powers of 
  base 2 aligning to bit boundaries.</p>
  <p>It is technically invalid to have non-zero bits in a CIDR address to 
  the right of the implied netmask. For user convenience this is however 
  configurable and can be disabled using a constructor argument.</p>
  <p>The constructor accepts CIDRs expressed in one of 4 different ways 
  :-</p>
  <p>A) Standard CIDR format :-</p>
  <p>IPv4:</p>
<pre class="literalblock">
   x.x.x.x/y -&gt; 192.0.2.0/24
</pre>
  <p>where the x's represent the network address and y is the netmask 
  prefix between 0 and 32.</p>
  <p>IPv6:</p>
<pre class="literalblock">
   x::/y -&gt; fe80::/10
</pre>
  <p>where the x's represent the network address and y is the netmask 
  prefix between 0 and 128.</p>
  <p>B) Abbreviated CIDR format (IPv4 only):</p>
<pre class="literalblock">
   x       -&gt; 192
   x/y     -&gt; 10/8
   x.x/y   -&gt; 192.168/16
   x.x.x/y -&gt; 192.168.0/24
</pre>
  <p>which are equivalent to:</p>
<pre class="literalblock">
   x.0.0.0/y   -&gt; 192.0.0.0/24
   x.0.0.0/y   -&gt; 10.0.0.0/8
   x.x.0.0/y   -&gt; 192.168.0.0/16
   x.x.x.0/y   -&gt; 192.168.0.0/24

   - The trailing zeros are implicit.
   - Old classful IP address rules apply if y is omitted.
</pre>
  <p>C) Hybrid CIDR format (prefix replaced by netmask) :-</p>
  <p>IPv4:</p>
<pre class="literalblock">
   x.x.x.x/y.y.y.y -&gt; 192.0.2.0/255.255.255.0
</pre>
  <p>IPv6:</p>
<pre class="literalblock">
   x::/y:: -&gt; fe80::/ffc0::
</pre>
  <p>where the y's represent a valid netmask.</p>
  <p>D) ACL-style CIDR format (prefix is replaced by a hostmask) :-</p>
  <p>Akin to Cisco's ACL (Access Control List) bitmasking (reverse 
  netmasks).</p>
  <p>IPv4:</p>
<pre class="literalblock">
   x.x.x.x/y.y.y.y -&gt; 192.0.2.0/0.0.0.255
</pre>
  <p>IPv6:</p>
<pre class="literalblock">
   x::/y:: -&gt; fe80::/3f:ffff:ffff:ffff:ffff:ffff:ffff:ffff
</pre>
  <p>where the y's represent a valid hostmask.</p>
  <p>Reference: RFCs 1338 and 4632.</p>

<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Instance Methods</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-InstanceMethods"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.CIDR-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">cidr</span>,
        <span class="summary-sig-arg">fmt</span>=<span class="summary-sig-default">&lt;class 'netaddr.address.IP'&gt;</span>,
        <span class="summary-sig-arg">strict</span>=<span class="summary-sig-default">True</span>,
        <span class="summary-sig-arg">expand_abbrev</span>=<span class="summary-sig-default">True</span>)</span><br />
      Constructor.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#CIDR.__init__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.CIDR-class.html#__sub__" class="summary-sig-name">__sub__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">other</span>)</span><br />
      Subtract another CIDR from this one.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#CIDR.__sub__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.CIDR-class.html#__add__" class="summary-sig-name">__add__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">other</span>)</span><br />
      Add another CIDR to this one returning a CIDR supernet that will 
      contain both in the smallest possible sized range.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#CIDR.__add__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.CIDR-class.html#previous" class="summary-sig-name">previous</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">step</span>=<span class="summary-sig-default">1</span>)</span><br />
      Returns:
      The immediate (adjacent) predecessor of this CIDR.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#CIDR.previous">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.CIDR-class.html#next" class="summary-sig-name">next</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">step</span>=<span class="summary-sig-default">1</span>)</span><br />
      Returns:
      The immediate (adjacent) successor of this CIDR.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#CIDR.next">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.CIDR-class.html#iter_host_addrs" class="summary-sig-name">iter_host_addrs</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Returns:
      An iterator object providing access to all valid host IP addresses 
      within the specified CIDR block.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#CIDR.iter_host_addrs">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.CIDR-class.html#supernet" class="summary-sig-name">supernet</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">prefixlen</span>=<span class="summary-sig-default">0</span>,
        <span class="summary-sig-arg">fmt</span>=<span class="summary-sig-default">None</span>)</span><br />
      Provides a list of supernet CIDRs for the current CIDR between the 
      size of the current prefix and (if specified) the end CIDR prefix.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#CIDR.supernet">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.CIDR-class.html#subnet" class="summary-sig-name">subnet</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">prefixlen</span>,
        <span class="summary-sig-arg">count</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">fmt</span>=<span class="summary-sig-default">None</span>)</span><br />
      A generator that returns CIDR subnets based on the current network 
      base address and provided CIDR prefix and count.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#CIDR.subnet">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.CIDR-class.html#cidrs" class="summary-sig-name">cidrs</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Returns:
      A list of a copy of this <a href="netaddr.address.CIDR-class.html" 
      class="link">CIDR</a> object.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#CIDR.cidrs">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.CIDR-class.html#__str__" class="summary-sig-name">__str__</a>(<span class="summary-sig-arg">self</span>)</span><br />
      str(x)</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#CIDR.__str__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.CIDR-class.html#__repr__" class="summary-sig-name">__repr__</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Returns:
      executable Python string to recreate equivalent object.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#CIDR.__repr__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__delattr__</code>,
      <code>__getattribute__</code>,
      <code>__new__</code>,
      <code>__reduce__</code>,
      <code>__reduce_ex__</code>,
      <code>__setattr__</code>
      </p>
    </td>
  </tr>
<tr bgcolor="#e8f0f8" >
  <th colspan="2" class="group-header"
    >&nbsp;&nbsp;&nbsp;&nbsp;Inherited from <a href="netaddr.address.IPRange-class.html">IPRange</a></th></tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.IPRange-class.html#__contains__" class="summary-sig-name">__contains__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">addr</span>)</span><br />
      Returns:
      <code>True</code> if given address or range falls within this range, 
      <code>False</code> otherwise.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#IPRange.__contains__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.IPRange-class.html#__eq__" class="summary-sig-name">__eq__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">other</span>)</span><br />
      Returns:
      <code>True</code> if the boundaries of this range are the same as 
      other, <code>False</code> otherwise.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#IPRange.__eq__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.IPRange-class.html#__ge__" class="summary-sig-name">__ge__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">other</span>)</span><br />
      Returns:
      <code>True</code> if the boundaries of this range are greater or 
      equal to other, <code>False</code> otherwise.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#IPRange.__ge__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.IPRange-class.html#__getitem__" class="summary-sig-name">__getitem__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">index</span>)</span><br />
      Returns:
      The IP address(es) in this address range referenced by index/slice.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#IPRange.__getitem__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.IPRange-class.html#__gt__" class="summary-sig-name">__gt__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">other</span>)</span><br />
      Returns:
      <code>True</code> if the boundaries of this range are greater than 
      other, <code>False</code> otherwise.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#IPRange.__gt__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.IPRange-class.html#__hash__" class="summary-sig-name">__hash__</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Returns:
      The hash of this address range.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#IPRange.__hash__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.IPRange-class.html#__iadd__" class="summary-sig-name">__iadd__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">i</span>)</span><br />
      Increments start and end addresses of this range by the current size.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#IPRange.__iadd__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.IPRange-class.html#__isub__" class="summary-sig-name">__isub__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">i</span>)</span><br />
      Decrements start and end addresses of this range by the current size.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#IPRange.__isub__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.IPRange-class.html#__iter__" class="summary-sig-name">__iter__</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Returns:
      An iterator object providing access to all network addresses within 
      this range.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#IPRange.__iter__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.IPRange-class.html#__le__" class="summary-sig-name">__le__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">other</span>)</span><br />
      Returns:
      <code>True</code> if the boundaries of this range are less or equal 
      to other, <code>False</code> otherwise.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#IPRange.__le__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.IPRange-class.html#__len__" class="summary-sig-name">__len__</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Returns:
      The total number of network addresses in this range.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#IPRange.__len__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.IPRange-class.html#__lt__" class="summary-sig-name">__lt__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">other</span>)</span><br />
      Returns:
      <code>True</code> if the boundaries of this range are less than 
      other, <code>False</code> otherwise.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#IPRange.__lt__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.IPRange-class.html#__ne__" class="summary-sig-name">__ne__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">other</span>)</span><br />
      Returns:
      <code>False</code> if the boundaries of this range are the same as 
      other, <code>True</code> otherwise.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#IPRange.__ne__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.IPRange-class.html#adjacent" class="summary-sig-name">adjacent</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">other</span>)</span><br />
      Returns:
      True if other's boundary touches the boundary of this address range, 
      False otherwise.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#IPRange.adjacent">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.IPRange-class.html#format" class="summary-sig-name">format</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">int_addr</span>,
        <span class="summary-sig-arg">fmt</span>=<span class="summary-sig-default">None</span>)</span><br />
      Returns:
      a network address in the format returned after passing it through 
      this object's fmt property callable.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#IPRange.format">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.IPRange-class.html#iprange" class="summary-sig-name">iprange</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Returns:
      A valid <a href="netaddr.address.IPRange-class.html" 
      class="link">IPRange</a> object for this address range.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#IPRange.iprange">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.IPRange-class.html#issubnet" class="summary-sig-name">issubnet</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">other</span>)</span><br />
      Returns:
      True if other's boundary is equal to or within this range.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#IPRange.issubnet">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.IPRange-class.html#issupernet" class="summary-sig-name">issupernet</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">other</span>)</span><br />
      Returns:
      True if other's boundary is equal to or contains this range.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#IPRange.issupernet">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.IPRange-class.html#overlaps" class="summary-sig-name">overlaps</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">other</span>)</span><br />
      Returns:
      True if other's boundary crosses the boundary of this address range, 
      False otherwise.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#IPRange.overlaps">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.IPRange-class.html#size" class="summary-sig-name">size</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Returns:
      The total number of network addresses in this range.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#IPRange.size">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.IPRange-class.html#tuple" class="summary-sig-name">tuple</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Returns:
      A 3-element tuple (first, last, addr_type) which represent the basic 
      details of this IPRange object.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#IPRange.tuple">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.IPRange-class.html#wildcard" class="summary-sig-name">wildcard</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Returns:
      A <a href="netaddr.address.Wildcard-class.html" 
      class="link">Wildcard</a> object equivalent to this CIDR.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#IPRange.wildcard">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== STATIC METHODS ==================== -->
<a name="section-StaticMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Static Methods</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-StaticMethods"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.CIDR-class.html#abbrev_to_verbose" class="summary-sig-name">abbrev_to_verbose</a>(<span class="summary-sig-arg">abbrev_cidr</span>)</span><br />
      A static method that converts abbreviated IPv4 CIDRs to their more 
      verbose equivalent.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#CIDR.abbrev_to_verbose">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.CIDR-class.html#span" class="summary-sig-name">span</a>(<span class="summary-sig-arg">addrs</span>,
        <span class="summary-sig-arg">fmt</span>=<span class="summary-sig-default">None</span>)</span><br />
      Static method that accepts a sequence of IP addresses and/or CIDRs, 
      Wildcards and IPRanges returning a single CIDR that is large enough 
      to span the lowest and highest IP addresses in the sequence (with a 
      possible overlap on either end).</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#CIDR.span">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="netaddr.address.CIDR-class.html#summarize" class="summary-sig-name">summarize</a>(<span class="summary-sig-arg">cidrs</span>,
        <span class="summary-sig-arg">fmt</span>=<span class="summary-sig-default">None</span>)</span><br />
      Static method that accepts a sequence of IP addresses and/or CIDRs 
      returning a summarized sequence of merged CIDRs where possible.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="netaddr.address-pysrc.html#CIDR.summarize">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== CLASS VARIABLES ==================== -->
<a name="section-ClassVariables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Class Variables</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-ClassVariables"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="STRATEGIES"></a><span class="summary-name">STRATEGIES</span> = <code title="ST_IPV4, ST_IPV6">ST_IPV4, ST_IPV6</code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="ADDR_TYPES"></a><span class="summary-name">ADDR_TYPES</span> = <code title="AT_UNSPEC, AT_INET, AT_INET6">AT_UNSPEC, AT_INET, AT_INET6</code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="strategy"></a><span class="summary-name">strategy</span> = <code title="StrategyDescriptor(STRATEGIES)">StrategyDescriptor(STRATEGIES)</code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="addr_type"></a><span class="summary-name">addr_type</span> = <code title="AddrTypeDescriptor(ADDR_TYPES)">AddrTypeDescriptor(ADDR_TYPES)</code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="prefixlen"></a><span class="summary-name">prefixlen</span> = <code title="PrefixLenDescriptor('CIDR')">PrefixLenDescriptor('CIDR')</code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="fmt"></a><span class="summary-name">fmt</span> = <code title="FormatDescriptor(IP)">FormatDescriptor(IP)</code>
    </td>
  </tr>
<tr bgcolor="#e8f0f8" >
  <th colspan="2" class="group-header"
    >&nbsp;&nbsp;&nbsp;&nbsp;Inherited from <a href="netaddr.address.IPRange-class.html">IPRange</a></th></tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="first"></a><span class="summary-name">first</span> = <code title="AddrValueDescriptor('first')">AddrValueDescriptor('first')</code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="last"></a><span class="summary-name">last</span> = <code title="AddrValueDescriptor('last')">AddrValueDescriptor('last')</code>
    </td>
  </tr>
</table>
<!-- ==================== PROPERTIES ==================== -->
<a name="section-Properties"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Properties</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Properties"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="netaddr.address.CIDR-class.html#network" class="summary-name">network</a>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="netaddr.address.CIDR-class.html#broadcast" class="summary-name">broadcast</a><br />
      <b>Please Note:</b> although IPv6 doesn't actually recognise the 
      concept of broadcast addresses per se (as in IPv4), so many other 
      libraries do this that it isn't worth trying to resist the trend just
      for the sake of making a theoretical point.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="netaddr.address.CIDR-class.html#netmask" class="summary-name">netmask</a>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="netaddr.address.CIDR-class.html#hostmask" class="summary-name">hostmask</a>
    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__class__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Method Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-MethodDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="abbrev_to_verbose"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">abbrev_to_verbose</span>(<span class="sig-arg">abbrev_cidr</span>)</span>
    <br /><em class="fname">Static Method</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="netaddr.address-pysrc.html#CIDR.abbrev_to_verbose">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>A static method that converts abbreviated IPv4 CIDRs to their more 
  verbose equivalent.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>abbrev_cidr</code></strong> - an abbreviated CIDR.
          <p>Uses the old-style classful IP address rules to decide on a 
          default subnet prefix if one is not explicitly provided.</p>
          <p>Only supports IPv4 addresses.</p>
          <p>Examples :</p>
<pre class="literalblock">
   10                  - 10.0.0.0/8
   10/16               - 10.0.0.0/16
   128                 - 128.0.0.0/16
   128/8               - 128.0.0.0/8
   192.168             - 192.168.0.0/16
</pre></li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>A verbose CIDR from an abbreviated CIDR or old-style classful 
          network address, <code>None</code> if format provided was not 
          recognised or supported.</dd>
  </dl>
</td></tr></table>
</div>
<a name="span"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">span</span>(<span class="sig-arg">addrs</span>,
        <span class="sig-arg">fmt</span>=<span class="sig-default">None</span>)</span>
    <br /><em class="fname">Static Method</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="netaddr.address-pysrc.html#CIDR.span">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Static method that accepts a sequence of IP addresses and/or CIDRs, 
  Wildcards and IPRanges returning a single CIDR that is large enough to 
  span the lowest and highest IP addresses in the sequence (with a possible
  overlap on either end).</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>addrs</code></strong> - a sequence of IP, CIDR, Wildcard or IPRange objects and/or their 
          string representations.</li>
        <li><strong class="pname"><code>fmt</code></strong> - (optional) callable used on return values. (Default: None - <a 
          href="netaddr.address.CIDR-class.html" class="link">CIDR</a> 
          object) Also accepts str() and unicode().</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>a single CIDR object spanning all addresses.</dd>
  </dl>
</td></tr></table>
</div>
<a name="summarize"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">summarize</span>(<span class="sig-arg">cidrs</span>,
        <span class="sig-arg">fmt</span>=<span class="sig-default">None</span>)</span>
    <br /><em class="fname">Static Method</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="netaddr.address-pysrc.html#CIDR.summarize">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Static method that accepts a sequence of IP addresses and/or CIDRs 
  returning a summarized sequence of merged CIDRs where possible. This 
  method doesn't create any CIDR that are inclusive of any addresses other 
  than those found in the original sequence provided.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>cidrs</code></strong> - a list or tuple of IP and/or CIDR objects.</li>
        <li><strong class="pname"><code>fmt</code></strong> - callable used on return values. (Default: None - <a 
          href="netaddr.address.CIDR-class.html" class="link">CIDR</a> 
          objects). str() and unicode() supported.</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>a possibly smaller list of CIDRs covering sequence passed in.</dd>
  </dl>
</td></tr></table>
</div>
<a name="__init__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">cidr</span>,
        <span class="sig-arg">fmt</span>=<span class="sig-default">&lt;class 'netaddr.address.IP'&gt;</span>,
        <span class="sig-arg">strict</span>=<span class="sig-default">True</span>,
        <span class="sig-arg">expand_abbrev</span>=<span class="sig-default">True</span>)</span>
    <br /><em class="fname">(Constructor)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="netaddr.address-pysrc.html#CIDR.__init__">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Constructor.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>cidr</code></strong> - a valid IPv4/IPv6 CIDR address or abbreviated IPv4 network 
          address.</li>
        <li><strong class="pname"><code>fmt</code></strong> - (optional) callable used on return values. Default: <a 
          href="netaddr.address.IP-class.html" class="link">IP</a> class. 
          See <a href="netaddr.address-module.html#nrange" 
          class="link">nrange()</a> documentations for more details on the 
          various options.</li>
        <li><strong class="pname"><code>strict</code></strong> - (optional) If True and non-zero bits are found to the right of 
          the subnet mask/prefix a ValueError is raised. If False, CIDR 
          returned has these bits automatically truncated. (default: True)</li>
        <li><strong class="pname"><code>expand_abbrev</code></strong> - (optional) If True, enables the abbreviated CIDR expansion 
          routine. If False, abbreviated CIDRs will be considered invalid 
          addresses, raising an AddrFormatError exception. (default: True)</li>
    </ul></dd>
    <dt>Overrides:
        object.__init__
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="__sub__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__sub__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">other</span>)</span>
    <br /><em class="fname">(Subtraction operator)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="netaddr.address-pysrc.html#CIDR.__sub__">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Subtract another CIDR from this one.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>other</code></strong> - a CIDR object that is greater than or equal to <code>self</code>.</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>A list of CIDR objects than remain after subtracting 
          <code>other</code> from <code>self</code>.</dd>
  </dl>
</td></tr></table>
</div>
<a name="__add__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__add__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">other</span>)</span>
    <br /><em class="fname">(Addition operator)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="netaddr.address-pysrc.html#CIDR.__add__">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Add another CIDR to this one returning a CIDR supernet that will 
  contain both in the smallest possible sized range.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>other</code></strong> - a CIDR object.</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>A new (potentially larger) CIDR object.</dd>
  </dl>
</td></tr></table>
</div>
<a name="previous"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">previous</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">step</span>=<span class="sig-default">1</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="netaddr.address-pysrc.html#CIDR.previous">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>step</code></strong> - the number of CIDRs between this CIDR and the expected one. 
          Default: 1 - the preceding CIDR.</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>The immediate (adjacent) predecessor of this CIDR.</dd>
  </dl>
</td></tr></table>
</div>
<a name="next"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">next</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">step</span>=<span class="sig-default">1</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="netaddr.address-pysrc.html#CIDR.next">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>step</code></strong> - the number of CIDRs between this CIDR and the expected one. 
          Default: 1 - the succeeding CIDR.</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>The immediate (adjacent) successor of this CIDR.</dd>
  </dl>
</td></tr></table>
</div>
<a name="iter_host_addrs"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">iter_host_addrs</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="netaddr.address-pysrc.html#CIDR.iter_host_addrs">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Returns:</dt>
        <dd>An iterator object providing access to all valid host IP 
          addresses within the specified CIDR block.
          <ul>
            <li>
              with IPv4 the network and broadcast addresses are always 
              excluded. Any smaller than 4 hosts yields an emtpy list.
            </li>
            <li>
              with IPv6 only the unspecified address '::' is excluded from 
              the yielded list.
            </li>
          </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="supernet"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">supernet</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">prefixlen</span>=<span class="sig-default">0</span>,
        <span class="sig-arg">fmt</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="netaddr.address-pysrc.html#CIDR.supernet">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Provides a list of supernet CIDRs for the current CIDR between the 
  size of the current prefix and (if specified) the end CIDR prefix.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>prefixlen</code></strong> - (optional) a CIDR prefix for the maximum supernet. Default: 0 - 
          returns all possible supernets.</li>
        <li><strong class="pname"><code>fmt</code></strong> - callable used on return values. Default: None - <a 
          href="netaddr.address.CIDR-class.html" class="link">CIDR</a> 
          objects. str() and unicode() supported.</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>an tuple containing CIDR supernets that contain this one.</dd>
  </dl>
</td></tr></table>
</div>
<a name="subnet"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">subnet</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">prefixlen</span>,
        <span class="sig-arg">count</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">fmt</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="netaddr.address-pysrc.html#CIDR.subnet">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>A generator that returns CIDR subnets based on the current network 
  base address and provided CIDR prefix and count.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>prefixlen</code></strong> - a CIDR prefix.</li>
        <li><strong class="pname"><code>count</code></strong> - number of consecutive CIDRs to be returned.</li>
        <li><strong class="pname"><code>fmt</code></strong> - callable used on return values. Default: None - <a 
          href="netaddr.address.CIDR-class.html" class="link">CIDR</a> 
          objects. str() and unicode() supported.</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>an iterator (as lists could potentially be very large) containing
          CIDR subnets below this CIDR's base address.</dd>
  </dl>
</td></tr></table>
</div>
<a name="cidrs"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">cidrs</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="netaddr.address-pysrc.html#CIDR.cidrs">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Returns:</dt>
        <dd>A list of a copy of this <a 
          href="netaddr.address.CIDR-class.html" class="link">CIDR</a> 
          object. This method is here mainly for compatibility with IPRange
          interface.</dd>
    <dt>Overrides:
        <a href="netaddr.address.IPRange-class.html#cidrs">IPRange.cidrs</a>
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="__str__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__str__</span>(<span class="sig-arg">self</span>)</span>
    <br /><em class="fname">(Informal representation operator)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="netaddr.address-pysrc.html#CIDR.__str__">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>str(x)</p>
  <dl class="fields">
    <dt>Overrides:
        object.__str__
        <dd><em class="note">(inherited documentation)</em></dd>
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="__repr__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__repr__</span>(<span class="sig-arg">self</span>)</span>
    <br /><em class="fname">(Representation operator)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="netaddr.address-pysrc.html#CIDR.__repr__">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>repr(x)</p>
  <dl class="fields">
    <dt>Returns:</dt>
        <dd>executable Python string to recreate equivalent object.</dd>
    <dt>Overrides:
        object.__repr__
    </dt>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== PROPERTY DETAILS ==================== -->
<a name="section-PropertyDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Property Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-PropertyDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="network"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">network</h3>
  
  <dl class="fields">
    <dt>Get Method:</dt>
    <dd class="value"><span class="summary-sig"><i>unreachable</i>.network(<span class="summary-sig-arg">self</span>)</span>
        - Returns:
The network (first) address in this CIDR block.
    </dd>
  </dl>
</td></tr></table>
</div>
<a name="broadcast"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">broadcast</h3>
  <p><b>Please Note:</b> although IPv6 doesn't actually recognise the 
  concept of broadcast addresses per se (as in IPv4), so many other 
  libraries do this that it isn't worth trying to resist the trend just for
  the sake of making a theoretical point.</p>
  <dl class="fields">
    <dt>Get Method:</dt>
    <dd class="value"><span class="summary-sig"><i>unreachable</i>.broadcast(<span class="summary-sig-arg">self</span>)</span>
        - <b>Please Note:</b> although IPv6 doesn't actually recognise the concept of
broadcast addresses per se (as in IPv4), so many other libraries do this 
that it isn't worth trying to resist the trend just for the sake of making 
a theoretical point.
    </dd>
  </dl>
</td></tr></table>
</div>
<a name="netmask"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">netmask</h3>
  
  <dl class="fields">
    <dt>Get Method:</dt>
    <dd class="value"><span class="summary-sig"><i>unreachable</i>.netmask(<span class="summary-sig-arg">self</span>)</span>
        - Returns:
The subnet mask address of this CIDR block.
    </dd>
  </dl>
</td></tr></table>
</div>
<a name="hostmask"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">hostmask</h3>
  
  <dl class="fields">
    <dt>Get Method:</dt>
    <dd class="value"><span class="summary-sig"><i>unreachable</i>.hostmask(<span class="summary-sig-arg">self</span>)</span>
        - Returns:
The host mask address of this CIDR block.
    </dd>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="netaddr-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://netaddr.googlecode.com/">Project Homepage</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Mon Apr 13 15:14:40 2009
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
